package top.lichuankai.wiki.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lichuankai.wiki.domain.Demo;
import top.lichuankai.wiki.domain.Test;
import top.lichuankai.wiki.service.DemoService;
import top.lichuankai.wiki.service.TestService;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class testhelloword {
    @Value("${test.hello:TEST}")
    String hello;

    @Resource
    TestService testService;

    @Resource
    DemoService demoService;

    @RequestMapping("hello")
    public String hello(){
        return "hello,world,李传开"+hello;
    }

    @GetMapping("/test/list")
    public List<Test> listTest(){
        return testService.list();
    }

    @GetMapping("/demo/list")
    public List<Demo> listdemo(){
        return demoService.list();
    }
}
